import 'package:flutter/material.dart';
import 'package:flutter_widgets/flutter_widgets.dart';

class ButtonSample extends StatelessWidget {
  static const routeName = 'button';

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: CommonAppBar(
        titleData: 'ButtonSample',
      ),
      body: Column(
        children: <Widget>[
          Wrap(
            spacing: 10,
            children: <Widget>[
              CommonFlatButton(text: 'flatButton-disabled', onPressed: null),
              CommonFlatButton(text: 'flatButton-enabled', onPressed: () {}),
              CommonFlatButton(
                text: 'flatButton-custom-enabled',
                onPressed: () {},
                style: const FlatButtonStyle(
                  highlightColor: Colors.green,
                  textStyle: TextStyle(color: Colors.lightGreenAccent),
                  disabledTextColor: Colors.grey,
                ),
              ),
            ],
          ),
          Wrap(
            spacing: 10,
            children: <Widget>[
              const CommonOutlinedButton(
                text: 'outlined-disabled',
                onPressed: null,
              ),
              CommonOutlinedButton(text: 'outlined-enabled', onPressed: () {}),
              CommonOutlinedButton(
                text: 'outlined-custom-enabled',
                onPressed: () {},
                style: const OutlinedButtonStyle(
                  width: 200,
                  height: 60,
                  highlightColor: Colors.green,
                  // splashColor: Colors.blueGrey,
                  textStyle: TextStyle(color: Colors.lightGreenAccent),
                  borderColor: Colors.lightGreenAccent,
                  borderWidth: 3,
                ),
              ),
            ],
          ),
          Wrap(
            spacing: 10,
            children: <Widget>[
              const CommonRaisedButton(
                text: 'raised-disabled',
                onPressed: null,
              ),
              CommonRaisedButton(text: 'raised-enabled', onPressed: () {}),
              CommonRaisedButton(
                text: 'raised-custom-enabled',
                onPressed: () {},
                style: const RaisedButtonStyle(
                  width: 200,
                  height: 50,
                  color: Colors.lightGreen,
                  highlightColor: Colors.green,
                  textStyle: TextStyle(color: Colors.lightGreenAccent),
                ),
              ),
            ],
          ),
          const Text('背景圆角由Theme.buttonTheme.shape设置'),
        ],
      ),
    );
  }
}
